#region File Description
//-----------------------------------------------------------------------------
// LineSettingsContent.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
#endregion

namespace XDLPipeline
{
    /// <summary>
    /// Settings class describes all the tweakable options used
    /// to control the appearance of a line system.
    /// </summary>
    public class LineSettingsContent
    {
        // Effect used to render this Line system.
        [ContentSerializerIgnore]
        public MaterialContent LineEffect;

        // Specifies which effect technique to use. If these Lines will never
        // rotate, we can use a simpler pixel shader that requires less GPU power.
        [ContentSerializer(Optional = true)]
        public string TechniqueName;

        // Name of the texture used by this Line system.
        [ContentSerializer(Optional = true)]
        public string TextureName = null;

        // Maximum number of Lines that can be displayed at one time.
        public int MaxLines = 100;

        // How long these Lines will last.
        public TimeSpan Duration = TimeSpan.FromSeconds(1);

        // If greater than zero, some Lines will last a shorter time than others.
        public float DurationRandomness = 0;

        // Controls how much Lines are influenced by the velocity of the object
        // which created them. You can see this in action with the explosion effect,
        // where the flames continue to move in the same direction as the source
        // projectile. The projectile trail Lines, on the other hand, set this
        // value very low so they are less affected by the velocity of the projectile.
        public float EmitterVelocitySensitivity = 1;

        // Direction and strength of the gravity effect. Note that this can point in any
        // direction, not just down! The fire effect points it upward to make the flames
        // rise, and the smoke plume points it sideways to simulate wind.
        public Vector3 Gravity = Vector3.Zero;

        // Controls how the Line velocity will change over their lifetime. If set
        // to 1, Lines will keep going at the same speed as when they were created.
        // If set to 0, Lines will come to a complete stop right before they die.
        // Values greater than 1 make the Lines speed up over time.
        public float EndVelocity = 1;

        // Range of values controlling the Line color and alpha. Values for
        // individual Lines are randomly chosen from somewhere between these limits.
        public Color MinColor = Color.White;
        public Color MaxColor = Color.White;

        // Range of values controlling how big the Lines are when first created.
        // Values for individual Lines are randomly chosen from somewhere between
        // these limits.
        public float MinStartSize = 100;
        public float MaxStartSize = 100;

        // Range of values controlling how big Lines become at the end of their
        // life. Values for individual Lines are randomly chosen from somewhere
        // between these limits.
        public float MinEndSize = 100;
        public float MaxEndSize = 100;

        // Alpha blending settings.
        public BlendState BlendState = BlendState.NonPremultiplied;

        /// <summary>
        /// Ground level (optional).
        /// </summary>
        [ContentSerializer(Optional = true)]
        public Nullable<double> GroundLevel = null;
    }
}
